/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __LED7SEG_H__
#define __LED7SEG_H__

/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"

/* Exported types ------------------------------------------------------------*/
typedef enum{
    BNT_MODE,
    BNT_REV,    
    BNT_INC,    
    BNT_DEC,    
    TOTAL_ACTIVE_BNT
} e_ACTIVE_BNT;

typedef enum{
    LED_TRAM,
    LED_CHUC,
    LED_DONVI,
    LED_REV,
    TOTAL_ACTIVE_LED
} e_ACTIVE_LED;

typedef enum{
    SEGMENT_A,
    SEGMENT_B,
    SEGMENT_C,
    SEGMENT_D,
    SEGMENT_E,
    SEGMENT_F,
    SEGMENT_G,
    SEGMENT_DP,
    TOTAL_SEGMENT
} e_SEGMENT_LED;

/* Exported constants --------------------------------------------------------*/
#define LED_TRAM_PORT   (GPIOC)
#define LED_TRAM_PINS   (GPIO_PIN_7)
#define LED_CHUC_PORT   (GPIOD)
#define LED_CHUC_PINS   (GPIO_PIN_2)
#define LED_DONVI_PORT  (GPIOD)
#define LED_DONVI_PINS  (GPIO_PIN_3)
#define LED_REV_PORT    (GPIOB)
#define LED_REV_PINS    (GPIO_PIN_4)

#define SEG_A_PORT      (GPIOD)
#define SEG_A_PINS      (GPIO_PIN_6)
#define SEG_B_PORT      (GPIOA)
#define SEG_B_PINS      (GPIO_PIN_3)
#define SEG_C_PORT      (GPIOC)
#define SEG_C_PINS      (GPIO_PIN_3)
#define SEG_D_PORT      (GPIOC)
#define SEG_D_PINS      (GPIO_PIN_5)
#define SEG_E_PORT      (GPIOC)
#define SEG_E_PINS      (GPIO_PIN_4)
#define SEG_F_PORT      (GPIOB)
#define SEG_F_PINS      (GPIO_PIN_5)
#define SEG_G_PORT      (GPIOD)
#define SEG_G_PINS      (GPIO_PIN_5)
#define SEG_DP_PORT     (GPIOB)
#define SEG_DP_PINS     (GPIO_PIN_4)

#define SW_IN_PORT      (GPIOC)
#define SW_IN_PIN       (GPIO_PIN_6)

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

void Led7Seg_Init(void);
void Led7Seg_SetDispAll(bool iDisp);
void Led7Seg_SetDispDp(bool iDispDp);
bool Led7Seg_GetDispDp(void);
void Led7Seg_Push(u16 iVal);
void Led7Seg_RunOne(void);

#endif /* __LED7SEG_H__ */

